package com.danny.demo.single.signle_model;

/**
 * @ClassName: SingleObject
 * @Description: 懒汉式，线程不安全
 * @Author: zhangdong
 * @Date: Created in 9:59 2019/6/26
 * @Version:
 */
public class SingleObject {

    private static  SingleObject instance;
    private SingleObject(){}

    public static SingleObject getInstance(){
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        if (instance == null){
            instance = new SingleObject();
        }
        return instance;
    }
}
